package com.liu.shiro.dao;

import com.liu.shiro.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository // 可以不写，主启动上加MapperScan替代
public interface UserMapper {
    @Select("select * from user where username = #{username}")
    User findByUsername(@Param("username")String username);



    @Select("select * from user where id=#{userId}")
    User findById(@Param("userId") int id);



    @Select("select * from user where username = #{username} and password = #{pwd}")
    User findByUsernameAndPwd(@Param("username")String username, @Param("pwd")String pwd);


}
